package com.sstock.smartstock;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class Notes extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.notes_editor);
		
		Button btn = (Button) findViewById(R.id.notes_btn_ok);
		final String code = getIntent().getStringExtra(Globals.UINAME_ALARMINTENT_CODE);
		btn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				EditText edit = (EditText) findViewById(R.id.stockNotes);
				String text = edit.getText().toString();
				Intent intent = new Intent();
				intent.putExtra(Globals.UINAME_NOTES, text);
				intent.putExtra(Globals.UINAME_ADD_CODE, code);					
				Notes.this.setResult(Activity.RESULT_OK, intent);
				Notes.this.finish();
			}
			
		});
	}

	
}
